package gov.tax.rti.base.security.entity;

import gov.tax.rti.core.security.entity.DataTag;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="RTI_SJBQ")
public class Sjbq extends BaseTag implements DataTag{
	/**
	 * 
	 */
	private static final long serialVersionUID = -490277282288352085L;
	
	private String parentId;
	private String order;
	private List<DataTag> children;
	private String model;
	
	@Id
	@GeneratedValue(generator = "guid")
	@GenericGenerator(name = "guid", strategy = "guid")
	@Column(name = "SJBQ_DM", unique = true, nullable = false, length = 32)
	public String getSjbqDm() {
		return super.getDm();
	}
	
	public void setSjbqDm(String sjbqDm) {
		super.setDm(sjbqDm);
	}
	
	@Column(name = "SJBQ_SX", nullable = false, length = 8)
	public String getSjbqSx() {
		return super.getSx();
	}
	
	public void setSjbqSx(String sjbqSx) {
		super.setSx(sjbqSx);
	}
	
	@Column(name = "SJBQ_BM", nullable = false, length = 32)
	public String getSjbqBm() {
		return super.getBm();
	}
	
	public void setSjbqBm(String sjbqBm) {
		setBm(sjbqBm);
	}
	
	@Column(name = "SJBQ_MC", nullable = false, length = 96)
	public String getSjbqMc() {
		return super.getMc();
	}
	
	public void setSjbqMc(String sjbqMc) {
		setMc(sjbqMc);
	}
	
	@Column(name = "SJBQ_SY", length = 16)
	public String getSjbqSy() {
		return super.getSy();
	}
	
	public void setSjbqSy(String sjbqSy) {
		setSy(sjbqSy);
	}
	
	/*@Column(name = "XZB", nullable = false,precision = 5,scale = 0)
	public int getXzb() {
		return xzb;
	}
	
	public void setXzb(int xzb) {
		this.xzb = xzb;
	}
	
	@Column(name = "YZB", nullable = false,precision = 5,scale = 0)
	public int getYzb() {
		return yzb;
	}
	public void setYzb(int yzb) {
		this.yzb = yzb;
	}
	
	@Column(name = "SJMX_DM", nullable = false, length = 32)
	public String getSjmxDm() {
		return mxDm;
	}

	public void setSjmxDm(String sjmxDm) {
		this.mxDm = sjmxDm;
	}*/
	
	@Transient
	@Override
	public String getParentId() {
		return parentId;
	}
	@Override
	public void setParentId(String parentId) {
		this.parentId = parentId;
	}
	
	@Transient
	@Override
	public String getOrder() {
		return order;
	}
	@Override
	public void setOrder(String order) {
		this.order = order;
	}
	
	@Transient
	@Override
	public List<DataTag> getChildren() {
		if(this.children == null){
			this.children = new ArrayList<DataTag>();
		}
		return this.children;
	}

	@Override
	public void setChildren(List<DataTag> children) {
		this.children = children;
	}

	@Transient
	@Override
	public String getModel() {
		return this.model;
	}

	@Override
	public void setModel(String model) {
		this.model = model;
	}
}
